package com.sky.mapper.admin;

import com.sky.pojo.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version: 1.0
 * @Author: 李佳毅
 * @description:
 * @date: 2025-07-07 19:52
 */
@Mapper
public interface SetmealDishMapper {

    //查询套餐表中有没有关联的菜品
    int selectCountByDishIds(@Param("ids") List<Long> ids);

    //批量插入套餐和菜品的关联关系
    int insertBatch(@Param("setmealDishes") List<SetmealDish> setmealDishes);

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    int deleteBySetmealId(Long setmealId);

    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> selectBySetmealId(Long setmealId);
}
